/**
 * 
 */
package de.cbf.cam.dsa.model.entities.items;

import java.beans.PropertyChangeSupport;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.persistence.Header;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class Item extends Header {
	/**
	 * @uml.property  name="name"
	 */
	protected String name;
	/**
	 * @uml.property  name="weight"
	 */
	protected float weight;
	/**
	 * @uml.property  name="description"
	 */
	protected String description;
	/**
	 * @uml.property  name="wear"
	 */
	protected String wear;
	
	public static final String PROPERTYNAME = "Item:";
	/**
	 * @uml.property  name="propertyChangeSupport"
	 */
	public PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
	
	public Item() {
		name		= "";
		description	= "";
		weight = 0f;
		wear ="";
	}

	public Item(String name,String place) {
		this.name			= name;		
		this.wear =place;
		description="";
		weight = 0f;		
	}

	@Override
	public String toString() {
		return name;
	}

	/**
	 * @return
	 * @uml.property  name="name"
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return
	 * @uml.property  name="description"
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param name
	 * @uml.property  name="name"
	 */
	public void setName(String name) {
		this.name = name;
		propertyChangeSupport.firePropertyChange(PROPERTYNAME+"name",null, name);
	}

	/**
	 * @param description
	 * @uml.property  name="description"
	 */
	public void setDescription(String description) {
		this.description = description;
		propertyChangeSupport.firePropertyChange(PROPERTYNAME+"description",null, description);
	}

	/**
	 * is weight in "Unzen"
	 * @return
	 * @uml.property  name="weight"
	 */
	public float getWeight() {
		return weight;
	}
	/**
	 * @param weight
	 * @uml.property  name="weight"
	 */
	public void setWeight(float weight) {
		this.weight = weight;
	}
	/**
	 * @return
	 * @uml.property  name="wear"
	 */
	public String getWear() {
		return wear;
	}
	/**
	 * @param place
	 * @uml.property  name="wear"
	 */
	public void setWear(String place) {
		this.wear = place;
	}

	@Override
	@Id
	public String getGuid() {
		return guid;
	}

	@Override
	public void setGuid(String guid) {
		this.guid = guid;		
	}	
}
